package com.xiaoyang.friend.domain.question.es;

import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

@Getter
@Setter
@Document(indexName = "idx_question")
public class QuestionES {

    @Id
    @Field(type = FieldType.Long)
    private Long questionId; // 题目id

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String title; // 题目标题

    @Field(type = FieldType.Byte)
    private Integer difficulty; // 题目难度

    @Field(type = FieldType.Long)
    private Long timeLimit; // 时间限制

    @Field(type = FieldType.Long)
    private Long spaceLimit; // 空间限制

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String content; // 题目描述

    @Field(type = FieldType.Text)
    private String questionCase; // 测试用例

    @Field(type = FieldType.Text)
    private String mainFuc; // 主函数

    @Field(type = FieldType.Text)
    private String defaultCode; // 默认代码

    @Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second)
    private LocalDateTime createTime; // 创建时间
}
